<template>
  <el-aside>
    <div id="app-title">ECA</div>
    <el-button type="text" :disabled="pageName == 'home'" @click="$router.push('/home')">
      <el-icon class="left-aligned"><HomeFilled /></el-icon>
      <div class="right-aligned page-name">仪表盘</div>
    </el-button>
    <el-button type="text" :disabled="pageName == 'userManager'" @click="$router.push('/userManager')" v-if="isAdmin === 'true'">
      <el-icon class="left-aligned"><UserFilled /></el-icon>
      <div class="right-aligned page-name">用户管理</div>
    </el-button>
    <el-button type="text" :disabled="pageName == 'conferenceManager'" @click="$router.push('/conferenceManager')" v-if="isAdmin === 'true'">
      <el-icon class="left-aligned"><Grid /></el-icon>
      <div class="right-aligned page-name">会议管理</div>
    </el-button>
    <el-button type="text" :disabled="pageName == 'myConference'" @click="$router.push('/myConference')">
      <el-icon class="left-aligned"><Checked /></el-icon>
      <div class="right-aligned page-name">我的会议</div>
    </el-button>
    <el-button type="text" :disabled="pageName == 'conferenceInvite'" @click="$router.push('/conferenceInvite')" v-if="isAdmin === 'true'">
      <el-icon class="left-aligned"><CirclePlusFilled /></el-icon>
      <div class="right-aligned page-name">邀请入会</div>
    </el-button>
    <el-button type="text" :disabled="pageName == 'dataPresentation'" @click="$router.push('/dataPresentation')">
      <el-icon class="left-aligned"><Histogram /></el-icon>
      <div class="right-aligned page-name">分析展示</div>
    </el-button>
  </el-aside>
</template>

<script>
export default {
  name: "Aside",
  data() {
    return {
      pageName: window.location.hash.slice(2),
      isAdmin: localStorage.getItem("admin")
    }
  }
};
</script>

<style scoped>
#app-title {
  width: 100%;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgb(62, 114, 209);
  color: #f6faff;
  font-size: 1.5vw;
  box-shadow: 1px 1px 7px rgba(0, 0, 0, 0.2);
  z-index: 2020;
}

.left-aligned {
  float: left;
}

.right-aligned {
  float: right;
}

.page-name {
  font-size: 15px;
}

#app-title > .el-button {
  width: 100%;
  height: 50px;
  padding: 0;
  margin: 0;
  /* color: #333; */
  background-color: #333;
  /* display: flex; */
}

.el-aside {
  background-color: #f6faff;
  color: #333;
  text-align: right;
  line-height: 50px;
  width: 150px;
}

/* body > .el-container {
  margin-bottom: 40px;
} */

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}

.el-button + .el-button {
  margin-left: 0px;
  justify-content: left !important;
}

.el-button {
  width: 130px;
  height: 40px;
  padding: 0;
  margin: 0;
  color: #333;
  margin-top: 10px;
  justify-content: left !important;
  margin-right: 10px;
  padding-left: 8.5%;
  box-shadow: 1px 1px 7px rgba(0, 0, 0, 0.15);
  
}

.el-button--text.is-disabled {
  background-color: #6aaafe !important;
  color: #ffffff;
}

.el-icon {
  font-size: 30px;
  line-height: 30px;
  color: #406683;
  margin: 0;
  margin-right: 5px;
}

.is-disabled > .el-icon{
  fill: #ad30a9 !important;
}
</style>